<template>
  <app-markdown :text="md"></app-markdown>
</template>
<script setup>
const props = defineProps({
  text: String,
  json: Object,
})

const md = computed(() => {
  let json
  if (props.text) {
    json = JSON.parse(props.text)
  } else {
    json = props.json
  }

  return `
  \`\`\`json
    ${JSON.stringify(json, null, 2)}
  \`\`\`
  `
})
</script>
<style lang="scss" scoped></style>
